Skip to content

Remove dependency on zumba/json-serializer #598

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

MauricioFauth
Copy link
Member

Instead of deserializing the data and then comparing it with the actual objects, this serializes the actual object and then compares it with the serialized data.

Adds duplicated information and the type of objects are lost, but this allows for the removal of zumba/json-serializer dependency.

We can develop a specialized serializer for this or use another method to test this data later on.

Instead of deserializing the data and then comparing it with the actual
objects, this serializes the actual object and then compares it with the
serialized data.

Adds duplicated information and the type of objects are lost, but this
allows for the removal of zumba/json-serializer dependency.

We can develop a specialized serializer for this or use another method
to test this data later on.

Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
Comment on lines +4 to +12
"KEYWORD_NAME_INDICATORS": [
"FROM",
"SET",
"WHERE"
],
"OPERATOR_NAME_INDICATORS": [
",",
"."
],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you implement something to drop the constants ?
they add quite some data and will cause all files to have to be updated on a new value added

"str": "WITH](",
"len": 6,
"last": 6,
"list": {
"@type": "PhpMyAdmin\\SqlParser\\TokensList",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

having the type was not too bad, but we can drop it

@williamdes
Copy link
Member

Well, if we can trim down a bit the diff by adding back @types and removing the consts that would be okay to me
Why do you want to drop this lib, is there a reason ?

@MauricioFauth
Copy link
Member Author

Why do you want to drop this lib, is there a reason ?

Nothing against this lib. It's because we don't actually need a full serializer for theses tests. I think we don't even need to use json for it.

@MauricioFauth
Copy link
Member Author

I just noticed that removing the PhpMyAdmin\SqlParser\Tools\CustomJsonSerializer is a BC break and this PR can't be merged. Because the class is in the src directory and it's not marked with the @internal annotation.
I'll annotate the classes inside PhpMyAdmin\SqlParser\Tools with @internal and do this changes in the master branch.

@MauricioFauth MauricioFauth self-assigned this Nov 14, 2024
@MauricioFauth MauricioFauth deleted the serializer-dep-removal branch December 2, 2024 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants